package chapter8;

import java.util.Vector;
/**
 * 
 * @author huyan
 *
 */
public class VectorList {
	public Vector v = new Vector();
	
	 
	public void listAdd(int index, Object object) {
	
		v.add(index, object);
	}
/**
 * 
 * @param index
 */
	public void listDelete(int index) {
		
		v.remove(index);
	}

	public Object listGet(int index) {
		
		Object object = v.get(index);
		return object;
	}

	public void listRun() {

		int a = v.size();
		for (int i = 0; i < a; i++) {
			Object object = v.get(i);
			System.out.println(object);
		}
	}
	public static void main(String args[]){
		VectorList list=new VectorList();
		for(int i=0;i<10;i++){
			list.listAdd(i, i);
		}
		list.listDelete(2);
		Object a=list.listGet(5);
		list.listRun();
		
	}
}
